/*
 * @Author: liuying 247220246@qq.com
 * @Date: 2025-03-17 16:07:52
 * @LastEditors: liuying 247220246@qq.com
 * @LastEditTime: 2025-03-19 11:58:31
 * @FilePath: \my-book-react\src\stores\slices\searchSlice.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createSlice } from '@reduxjs/toolkit';
const searchSlice = createSlice({
  name: 'search',
  initialState: {
    searchKeyword: '',
    searchMode: false,
  },
  reducers: {
    setSearchKeyword: (state, action) => {
      state.searchKeyword = action.payload;
    },
    setSearchMode: (state, action) => {
      state.searchMode = action.payload;
    },
  },
});
export const { setSearchKeyword, setSearchMode } = searchSlice.actions;
export default searchSlice.reducer;
